package mdt.ext;

import org.tigris.gef.presentation.FigRRect;
import mdt.action.SetFigShapeAttrAction;

import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.util.Vector;

/**
 * Created by xiaobyu on 7/19/2016.
 */
public class FigRRectExt extends FigRRect {

    public FigRRectExt(
            final int x,
            final int y,
            final int w,
            final int h) {
        super(x, y, w, h);
    }

    /**
     * Construct a new resizable FigRect with the given position, size, line
     * color, and fill color.
     */
    public FigRRectExt(
            final int x,
            final int y,
            final int w,
            final int h,
            final Color lColor,
            final Color fColor) {
        super(x, y, w, h, lColor, fColor);
    }

    /** Construct a new FigRect w/ the given position and size. */
    public FigRRectExt(
            final int x,
            final int y,
            final int w,
            final int h,
            final boolean resizable) {
        super(x, y, w, h);
        setResizable(resizable);
    }

    public Vector getPopUpActions(MouseEvent me) {
        Vector popUpActions = super.getPopUpActions(me);
        popUpActions.add(new JSeparator());
        popUpActions.add(new JMenuItem(new SetFigShapeAttrAction()));
        return popUpActions;
    }
}